﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace Es.Abp.Domain.Entities
{
    public class StudentEntity : Entity<long>
    {
        [SugarColumn( IsPrimaryKey = true)]
        public override long Id { get => base.Id; protected set => base.Id = value; }
        public StudentEntity() { }

        public StudentEntity(string name, int age)
        {
            this.Name = name;
            this.Age = age;
        }

        public string Name { get; set; }
        public int Age { get; set; }


        public string? Remarks { get; set; }

        public bool IsNameWang()
        {
            return this.Name.Contains("王");
        }

        public void SetAge(int age = 18)
        {
            this.Age = age;
        }
    }
}
